home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / T / The Survey Editor2.0.HC.cpt / The Survey Editor 2.0 / stack.txt < prev   
Text File  |  1990-01-30  |  17KB  |  487 lines

  1. -- stack: in.0
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 1
  11. -- first background id: 2767
  12. -- card count: 4
  13. -- first card id: 2955
  14. -- list block id: 3733
  15. -- print block id: 0
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 62944 bytes
  21. -- stack block size: 15872 bytes
  22. -- created by hypercard version: 0x01228000
  23. -- compacted by hypercard version: 0x01228000
  24. -- modified by hypercard version: 0x01228000
  25. -- opened by hypercard version: 0x01228000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. on openStack
  69.   set cursor to watch
  70.   if the version < 1.2 then
  71.     answer "Sorry, I need HyperCard 1.2 or greater."
  72.     set lockMessages to true
  73.     go home
  74.     exit openStack
  75.   end if
  76.   hide menuBar
  77.   global User_level
  78.   put the userlevel into User_level
  79.   set the userlevel to 5
  80.   global commandLIST
  81.   put cd field "commandLIST" into commandLIST
  82.  
  83.   put "About...,(-,New,Open.../A,(-,Save,Save As.../W,Revert,(-,Print...," & "Print Code...,(-,Show All Code/G,Show Code of a Line..." into EditorMenu
  84.   put "Add,Insert,Replace,Edit,Delete,(-,Label Above Command" into CommandsMenu
  85.   put "Bell,Tab,Clear Screen,Backspace,(-,Other..." into CtrlMENU
  86.  
  87.   menuHandler "add","Editor",EditorMenu
  88.   menuHandler "add","Commands",CommandsMenu
  89.   menuHandler "add","Insert Control...",CtrlMENU
  90.   menuHandler "hide","Insert Control...",CtrlMENU
  91.  
  92.   if the hilite of cd btn "label above command" is true then
  93.     repeat with x = 2 to 5
  94.       menuHandler "disable","commands",x
  95.     end repeat
  96.     menuHandler "disable","Editor",13
  97.     menuHandler "mark","commands","Label Above Command","check"
  98.   end if
  99. end openStack
  100.  
  101. on CloseStack
  102.   lock screen
  103.   set cursor to watch
  104.   go cd 1
  105.   if cd field id 99 ‚↠""
  106.   then set the hilite of cd btn id (item 1 of cd field id 99) to false
  107.   put "" into cd field id 99
  108.   menuHandler "delete","Editor"
  109.   menuHandler "delete","Commands"
  110.   menuHandler "delete","Insert Control..."
  111.   if the freesize of this stack > 25000 then domenu "compact stack"
  112.   global User_level
  113.   set the userlevel to User_level
  114.   show menubar
  115. end CloseStack
  116.  
  117. Function lineClicked
  118. return (trunc(((scroll of the target) + (item two of the clickloc) - (item two of the rect of the target)) div the textheight of the target) + one)
  119. end lineClicked
  120.  
  121. function realName fichier
  122. put "" into applName
  123. repeat with x = the number of chars in fichier down to 1
  124.   if char x of fichier = ":" then
  125.     exit repeat
  126.   else
  127.     put char x of fichier before applName
  128.   end if
  129. end repeat
  130. return applName
  131. end realname
  132.  
  133. Function theLineClicked clickLic
  134. return (trunc(((scroll of cd field "survey") + (item two of clickLic) - (item two of the rect of cd field "survey")) div the textheight of cd field "survey") + one)
  135. end theLineClicked
  136.  
  137. function compute name,tType,text,length,branch
  138. global commandLIST
  139. put "" into displayString
  140.  
  141. put "0,5,6,8,18,37,38,43,44,45,46" into exceptions
  142. repeat with x = 1 to 11
  143.   if tType = item x of exceptions then
  144.     put line (tType+1) of commandLIST into displayString
  145.     if name ‚↠"" then
  146.       put "  ‚Ä¢" && name && "‚Ä¢" after displayString
  147.     end if
  148.     return displayString
  149.     exit compute
  150.   end if
  151. end repeat
  152.  
  153. if tType = 1 then
  154.   if length = 0 then
  155.     put "Display ‚Äú" & text & "‚Äù with a CR"  after displayString
  156.   else
  157.     put "Display ‚Äú" & text & "‚Äù with no CR"  after displayString
  158.   end if
  159. end if
  160. if tType = 2 then
  161.   put "Branch immediately to ‚Äú" & branch & "‚Äù" into displayString
  162. end if
  163. if tType = 3 then
  164.   put "If last input contains ‚Äú" & text & "‚Äù, branch to ‚Äú" & branch & "‚Äù" into displayString
  165. end if
  166. if tType = 4 then
  167.   put "If last input was empty, branch to ‚Äú" & branch & "‚Äù" into displayString
  168. end if
  169. if tType = 7 then
  170.   put "Stop execution of the Survey file and return to the last " & "Red Ryder Host menu." into displayString
  171. end if
  172. if tType = 9 then
  173.   put "Get input [" & length & "] from the user." into displayString
  174.   if text ‚↠"" then
  175.     put "Display ‚Äú" & text & "‚Äù and " before displayString
  176.   end if
  177. end if
  178. if tType = 10 then
  179.   put "Get 'Y' or 'N' from the user." into displayString
  180.   if text ‚↠"" then
  181.     put "Display ‚Äú" & text & "‚Äù and " before displayString
  182.   end if
  183. end if
  184. if tType = 11 then
  185.   put "Get a CR from the user." into displayString
  186.   if text ‚↠"" then
  187.     put "Display ‚Äú" & text & "‚Äù and " before displayString
  188.   end if
  189. end if
  190. if tType = 12 then
  191.   put "Display ‚Äú" & text & "‚Äù with CR to the scratch file." into displayString
  192. end if
  193. if tType = 13 then
  194.   put "Display ‚Äú" & text & "‚Äù with no CR to the scratch file." into displayString
  195. end if
  196. if tType = 14 then
  197.   put "Raise current caller's time limit for this call only to " & length into displayString
  198. end if
  199. if tType = 15 then
  200.   put "Raise current caller's time limit permanently to " & length into displayString
  201. end if
  202. if tType = 16 then
  203.   put "Set the caller's clearance level for this for this call only to " & length into displayString
  204. end if
  205. if tType = 17 then
  206.   put "Set the caller's clearance level permanently to " & length into displayString
  207. end if
  208. if tType = 19 then
  209.   put "Write the value of ASCII character ‚Äú" & text & "‚Äù to the response file." into displayString
  210. end if
  211. if tType = 20 then
  212.   put "Clear out the scratch file and branch to ‚Äú" & branch & "‚Äù" into displayString
  213. end if
  214. if tType = 21 then
  215.   put "If the user's down/upload ratio is less than " & text & ", then branch to ‚Äú" & branch & "‚Äù" into displayString
  216. end if
  217. if tType = 22 then
  218.   put "Temporarily sets the current caller's restriction flag " & "number " & text into displayString
  219. end if
  220. if tType = 23 then
  221.   put "Permanently sets the current caller's restriction flag " & "number " & text into displayString
  222. end if
  223. if tType = 24 then
  224.   put "Temporarily resets the current caller's restriction flag " & "number " & text into displayString
  225. end if
  226. if tType = 25 then
  227.   put "Permanently resets the current caller's restriction flag " & "number " & text into displayString
  228. end if
  229. if tType = 26 or tType = 27 or tType = 28 or tType = 29 then
  230.   put "Display TEXT file ‚Äú" & realName(text) into displayString
  231.   if tType = 26 then put "‚Äù (Cancellable, no prompts)" after displayString
  232.   if tType = 27 then put "‚Äù (Cancellable, all prompts)" after displayString
  233.   if tType = 28 then put "‚Äù (Not cancellable, all prompts)" after displayString
  234.   if tType = 29 then put "‚Äù (Cancellable, only final prompts)" after displayString
  235. end if
  236. if tType = 30 then
  237.   put "Create a Special Scratch File and allocate " & text & " accumulators."into displayString
  238. end if
  239. if tType = 31 then
  240.   put "Add " & item 1 of text & " to the Special Scratch File " & "accumulator " & item 2 of text into displayString
  241. end if
  242. if tType = 32 then
  243.   put "Add the contents of Special Scratch accumulator " & item 1 of text & " to the Special Scratch File " & "accumulator " & item 2 of text into displayString
  244. end if
  245. if tType = 33 then
  246.   put "Display the string equivalent of the Special Scratch file " & "accumulator " & text & " with a CR." into displayString
  247. end if
  248. if tType = 34 then
  249.   put "Display the string equivalent of the .CNT file " & "accumulator " & text & " with a CR." into displayString
  250. end if
  251. if tType = 35 then
  252.   put "Display the string equivalent of the Special Scratch file " & "accumulator " & text & " with no CR." into displayString
  253. end if
  254. if tType = 36 then
  255.   put "Display the string equivalent of the .CNT file " & "accumulator " & text & " with no CR." into displayString
  256. end if
  257. if tType = 39 then
  258.   put "If current caller's name appears in .CNT file, execute " & "the survey: ‚Äú" & realName(branch) & "‚Äù." into displayString
  259. end if
  260. if tType = 40 then
  261.   put "Put " & item 2 of text & " into the Special " & "Scratch accumulator " & item 1 of text into displayString
  262. end if
  263. if tType = 41 then
  264.   put "Display the percentage that .CNT file accumulator " & item 1 of text & " is of .CNT file acc. " & item 2 of text & " with a CR." into displayString
  265. end if
  266. if tType = 42 then
  267.   put "Display the percentage that .CNT file accumulator " & item 1 of text & " is of .CNT file acc. " & item 2 of text & " with no CR." into displayString
  268. end if
  269. if name ‚↠"" then
  270.   put "  ‚Ä¢" && name && "‚Ä¢" after displayString
  271. end if
  272. return displayString
  273. end compute
  274.  
  275. on command commandNumber,displayString
  276.   put return into r
  277.   lock screen
  278.   if commandNumber = 0 then
  279.     put "" & r & "" & r & "0" & r & "" & r & "" & r & "" into command
  280.     WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
  281.     exit command
  282.   end if
  283.  
  284.   if commandNumber = 1 then
  285.     go cd "input"
  286.     initiate true,"Label:",false,"",false,"",true, "Text to display...",true,false,1,displayString
  287.     exit command
  288.   end if
  289.  
  290.   if commandNumber = 2 then
  291.     go cd "input"
  292.     initiate false,"",false,"",true,"Branch to:",false, "",false,false,2,displayString
  293.     exit command
  294.   end if
  295.  
  296.   if commandNumber = 3 then
  297.     go cd "input"
  298.     initiate true,"Label:",false,"",true, "Branch to:",true,"Text to verify...",false,false,3,displayString
  299.     exit command
  300.   end if
  301.  
  302.   if commandNumber = 4 then
  303.     go cd "input"
  304.     initiate false,"",false,"",true, "Branch to:",false,"",false,false,4,displayString
  305.     exit command
  306.   end if
  307.  
  308.   if commandNumber = 5 or commandNumber = 6 then
  309.     put "" & r & "" & r & commandNumber & r & "" & r & "" & r & "" into command
  310.     WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
  311.     exit command
  312.   end if
  313.  
  314.   if commandNumber = 7 then
  315.     go cd "input"
  316.     initiate true,"Label:",false,"",false, "",false,"",false,false,7,displayString
  317.     exit command
  318.   end if
  319.  
  320.   if commandNumber = 8 then
  321.     put "" & r & "" & r & "8" & r & "" & r & "" & r & "" into command
  322.     WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
  323.     exit command
  324.   end if
  325.  
  326.   if commandNumber = 9 then
  327.     go cd "input"
  328.     initiate true,"Label:",true,"Length Maximum:",false,"",true, "Display this text (empty if nothing)...",false,false,9,displayString
  329.     exit command
  330.   end if
  331.  
  332.   if commandNumber = 10 then
  333.     go cd "input"
  334.     initiate true,"Label:",true,"Length:",false, "",true,"Display this text (empty if nothing)..." ,false,false,10,displayString
  335.     put "1" into cd field "length"
  336.     exit command
  337.   end if
  338.  
  339.   if commandNumber = 11 then
  340.     go cd "input"
  341.     initiate true,"Label:",false,"",false, "",true,"Display this text (empty if nothing)..." ,false,false,11,displayString
  342.     put "1" into cd field "length"
  343.     exit command
  344.   end if
  345.  
  346.   if commandNumber = 12 then
  347.     go cd "input"
  348.     initiate true,"Label:",false,"",false, "",true,"Text to display...",false,false,12,displayString
  349.     put "1" into cd field "length"
  350.     exit command
  351.   end if
  352.  
  353.   if commandNumber = 13 then
  354.     go cd "input"
  355.     initiate true,"Label:",false,"",false, "",true,"Text to display...",false,false,13,displayString
  356.     put "1" into cd field "length"
  357.     exit command
  358.   end if
  359.  
  360.   if commandNumber = 14 or commandNumber = 15 then
  361.     go cd "input"
  362.     initiate true,"Label:",true,"New Time Limit:",false, "",false,"",false,false,commandNumber,displayString
  363.     put "1" into cd field "length"
  364.     exit command
  365.   end if
  366.  
  367.   if commandNumber = 16 or commandNumber = 17 then
  368.     go cd "input"
  369.     initiate true,"Label:",true,"New Level:",false, "",false,"",false,false,commandNumber,displayString
  370.     put "1" into cd field "length"
  371.     exit command
  372.   end if
  373.  
  374.   if commandNumber = 18 then
  375.     put fileName("MENU","Select the menu to return to...") into text
  376.     if text is empty then exit command
  377.     put "Stop the survey and return to RRH menu ‚Äú" & text & "‚Äù" into displayString
  378.     put "" & r & "" & r & "18" & r & text & r & "" & r & "" into command
  379.     WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
  380.     exit command
  381.   end if
  382.  
  383.   if commandNumber = 19 then
  384.     go cd "input"
  385.     initiate true,"Label:",false,"",false,"",true, "ASCII character to write...",false,false,19,displayString
  386.     exit command
  387.   end if
  388.  
  389.   if commandNumber = 20 then
  390.     go cd "input"
  391.     initiate false,"",false,"",true, "Clear out the scratch file and branch to:",false, "",false,false,20,displayString
  392.     exit command
  393.   end if
  394.  
  395.   if commandNumber = 21 then
  396.     go cd "input"
  397.     initiate true,"Label:",false,"",true,"Branch:",true, "User's download to upload ratio...",false,false,21,displayString
  398.     exit command
  399.   end if
  400.  
  401.   if commandNumber = 22 or commandNumber = 23 then
  402.     go cd "input"
  403.     initiate true,"Label:",false,"",false, "",true," Set restriction flag number...", false,false,commandNumber,displayString
  404.     exit command
  405.   end if
  406.  
  407.   if commandNumber = 24 or commandNumber = 25 then
  408.     go cd "input"
  409.     initiate true,"Label:",false,"",false, "",true,"Reset restriction flag number...", false,false,commandNumber,displayString
  410.     exit command
  411.   end if
  412.  
  413.   if commandNumber = 26 or commandNumber = 27 or commandNumber = 28 or commandNumber = 29 then
  414.     go cd "input"
  415.     initiate true,"Label:",false,"",false, "",true,"Text file to display:", false,true,commandNumber,displayString
  416.     exit command
  417.   end if
  418.  
  419.   if commandNumber = 30 then
  420.     go cd "input"
  421.     initiate false,"",false,"",false,"",true, "Number of Accumulators to allocate:",false,false,30,displayString
  422.     exit command
  423.   end if
  424.  
  425.   if commandNumber = 31 then
  426.     go cd "input"
  427.     initiate false,"",false,"",false,"",true, "Number to add, Accumulator y (separated by a comma)...",false,false,31,displayString
  428.     exit command
  429.   end if
  430.  
  431.   if commandNumber = 32 then
  432.     go cd "input"
  433.     initiate false,"",false,"",false,"",true, "Accumulator x, Accumulator y (separated by a comma)...", false,false,32,displayString
  434.     exit command
  435.   end if
  436.  
  437.   if commandNumber = 33 or commandNumber = 35 then
  438.     go cd "input"
  439.     initiate false,"",false,"",false, "",true,"Special Scratch file accumulator number...", false,false,commandNumber,displayString
  440.     exit command
  441.   end if
  442.  
  443.   if commandNumber = 34 or commandNumber = 36 then
  444.     go cd "input"
  445.     initiate false,"",false,"",false, "",true,".CNT file accumulator number...", false,false,commandNumber,displayString
  446.     exit command
  447.   end if
  448.  
  449.   if commandNumber = 37 or commandNumber = 38 then
  450.     put "" & r & "" & r & commandNumber & r & "" & r & "" & r & "" into command
  451.     WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
  452.     exit command
  453.   end if
  454.  
  455.   if commandNumber = 39 then
  456.     go cd "input"
  457.     initiate false,"",false,"",true,"Survey file to branch to: ",false,"",false,true,39,displayString
  458.     exit command
  459.   end if
  460.  
  461.   if commandNumber = 40 then
  462.     go cd "input"
  463.     initiate false,"",false,"",false,"",true, "Acc. y to set, Number x (separated by a comma)...",false,false,40,displayString
  464.     exit command
  465.   end if
  466.  
  467.   if commandNumber = 41 or commandNumber = 42 then
  468.     go cd "input"
  469.     initiate false,"",false,"",false, "",true,"Accumulator x, Accumulator y (separated by a comma)...", false,false,commandNumber,displayString
  470.     exit command
  471.   end if
  472.  
  473.   if commandNumber = 43 or commandNumber = 44 or commandNumber = 45 or commandNumber = 46 then
  474.     put "" & r & "" & r & commandNumber & r & "" & r & "" & r & "" into command
  475.     WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
  476.     exit command
  477.   end if
  478. end command
  479.  
  480. on WRTstrg a,b,c,d
  481.   lock screen
  482.   set lockMessages to true
  483.   writeString a,b,c,d
  484. end WRTstrg
  485.  
  486.  
  487.